import 'package:proj_sfv/http/api.dart';

class UserDetail {
  String userName;
  String profile;
  String signature;
  bool gender;
  String currentAddress;
  int followsCount;
  int fansCount;
  int likeCount;

  UserDetail(this.userName, this.profile, this.signature, this.gender,
      this.currentAddress, this.followsCount, this.fansCount, this.likeCount);

  UserDetail.empty(): userName = "", profile = "", signature = "", gender = true, currentAddress = "",
    followsCount = 0, fansCount = 0, likeCount = 0;

  UserDetail.fromJson(Map<String, dynamic> data) {
    userName = data['userName'];
    profile = Uri.https(cosHost, '${data['profile']}.jpg').toString();
    signature = data['signature'] ?? "当前用户还没有签名哟";
    gender = data['gender'];
    currentAddress = data['currentAddress'] ?? "未知位置";
    followsCount = data['followsCount'];
    fansCount = data['fansCount'];
    likeCount = data['likeCount'];
  }
}